<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page language="java" import="com.server.web.JsVersionUtil"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>后台管理-菜单管理</title>
		<link rel="stylesheet" href='<c:url value="/share/pintuer.css"></c:url>'>
		<link rel="stylesheet" href='<c:url value="/share/admin.css"></c:url>' >
		<script type="text/javascript" src='<c:url value="/js/jquery.js"></c:url>' ></script>
		<script type="text/javascript" src='<c:url value="/js/pintuer.js"></c:url>'></script>
		<script type="text/javascript" src='<c:url value="/js/admin.js"></c:url>'></script>
		<script type="text/javascript" src='<c:url value="/js/layer.js"></c:url>'></script>
</head>

	<body>
	<!--内容-->
		<form method="post">
	    <div class="panel admin-panel">
	    	<div class="panel-head"><strong>菜单列表</strong></div>
	        <div class="padding border-bottom">
	            <a class="button button-small border-green" href="<c:url value='/adminMenu/addMenuFirst'></c:url>" >添加一级菜单</a>
	            <a class="button button-small border-green" href="<c:url value='/adminMenu/addMenuSecond'></c:url>" >添加二级菜单</a>
	        </div>
	        <table class="table table-hover">
	        	<tr>
	        		<th>名称</th>
	        		<th>FUNCTION</th>
	        		<th>排序</th>
	        		<th>操作</th>
	        	</tr>
	        	<c:forEach items="${menuList}" var="m">
				<tr style="background-color: #f5f5f5;">
					<td style="font-weight: bold;">${m.name}</td>
					<td></td>
					<td>${m.sort}</td>
					<td><a class="button border-blue button-little dialogs"
						href="<c:url value='/adminMenu/editMenu?id=${m.id}'></c:url>">修改</a>
						<a class="button border-yellow button-little"
						href="<c:url value='/adminMenu/deleteMenu?id=${m.id}'></c:url>"
						onclick="{if(confirm('确认删除?')){return true;}return false;}">删除</a>
					</td>
				</tr>
	        	<c:forEach items="${m.menu_sub}" var="sub_m">
	        	<tr>
		        	<td>&nbsp;&nbsp;&nbsp;&nbsp;${sub_m.name}</td>
		        	<td>${sub_m.function}</td>
		        	<td>${sub_m.sort}</td>
		        	<td><a class="button border-blue button-little dialogs"
						href="<c:url value='/adminMenu/editMenu?id=${sub_m.id}'></c:url>">修改</a>
						<a class="button border-yellow button-little"
						href="<c:url value='/adminMenu/deleteMenu?id=${sub_m.id}'></c:url>"
						onclick="{if(confirm('确认删除?')){return true;}return false;}">删除</a>
					</td>
				</tr>
	        	</c:forEach>
	        	</c:forEach>
	        </table>
	    </div>
	    </form>
		<!--底部-->
	</body>

</html>